<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common.html :: head"></head>
<body class="layui-fluid">
<div class="layui-row layui-col-space8">
    <div class="layui-col-md8">
        <div class="layui-card">
            <div class="layui-card-header">数据内容</div>
            <div class="layui-card-body">
                <div class="layui-form" lay-filter="dataForm">
                    <div th:insert="module/common-form"></div>
                    <hr class="layui-bg-black">
                    <div class="layui-form-item">
                        <label class="layui-form-label">银行编码</label>
                        <div class="layui-input-block">
                            <input type="text" name="bank_code" required  value="" lay-verify="required" placeholder="请输入银行编码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">缴款日期</label>
                        <div class="layui-input-block">
                            <input type="text" name="pay_date" required  value="" lay-verify="required" placeholder="请输入缴款日期" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">资金批次号</label>
                        <div class="layui-input-block">
                            <input type="text" name="batch_no" required  value="" lay-verify="required" placeholder="请输入资金批次号" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">金额</label>
                        <div class="layui-input-block">
                            <input type="text" name="amt" required  value="" lay-verify="required" placeholder="请输入金额" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">账号</label>
                        <div class="layui-input-block">
                            <input type="text" name="account" required  value="" lay-verify="required" placeholder="请输入账号" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">账号类型</label>
                        <div class="layui-input-block">
                            <input type="text" name="account_type" required  value="" lay-verify="required" placeholder="请输入账号类型" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="sendRestpay">立即发送</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-col-md4">
        <div class="layui-card">
            <div class="layui-card-header">日志内容 <i class="layui-icon layui-icon-delete" id="deleteLogs"></i></div>
            <div class="layui-card-body">
                <div id="logAppend" class="layui-code" style="word-wrap:break-word"></div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/html" id="appIdTemp">
    <div class="layui-col-md3">
        <div class="layui-form-item">
            <label class="layui-form-label">appId</label>
            <div class="layui-input-block">
                <input type="text" name="appId" value="bs" placeholder="请输入appId" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-col-md3">
        <div class="layui-form-item">
            <label class="layui-form-label">appKey</label>
            <div class="layui-input-block">
                <input type="text" name="appKey" value="999" placeholder="请输入appKey" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
    </div>
</script>
<script type="text/html" id="tokenTemp">
    <div class="layui-col-md6">
        <div class="layui-form-item">
            <label class="layui-form-label">token</label>
            <div class="layui-input-block">
                <input type="text" name="token" value="BS_NONTAX_TOKEN" placeholder="请输入token" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
    </div>
</script>
<script>
    layui.use(['epay','layer'],function () {
        var form = layui.form;
        var dhh = layui.dhh;
        var epay = layui.epay;
        var $ = layui.$;
        var layer =  layui.layer;
        form.on('submit(sendRestpay)', function(data){
            dhh.post('/epay/sendRestPay',data.field,function (response) {
                layer.msg(response.msg ? response.msg : 'success');
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
        form.on('switch(stdClient)', function(data){
            var cheched = data.elem.checked;
            var html = cheched ? $("#appIdTemp").html() : $("#tokenTemp").html();
            $("#appIdBlock").html(html);
        });
    })
</script>
</html>